import { get, post, del, put } from "@/utils/request";
import { type listReturn, type listParams, type addParams, type houseListData } from "./type";

// 房间列表
export const houseList = (data: listParams) => {
  return get<listParams, listReturn>("/api/house/list", data);
};

// 房间添加
export const houseAdd = (data: addParams) => {
  return post<addParams, houseListData>("/api/house/add", data);
};

// 房间修改
export const houseUpdate = (data: addParams) => {
  return put<addParams, houseListData>("/api/house/update", data);
};

// 房间删除
export const houseDel = (id: number) => {
  return del<number, string>(`/api/house/delete/${id}`);
};

// 房间批量删除
export const houseDelAll = (data: number[]) => {
  return post<number[], string>("/api/house/deleteAll", data);
};
